#include"sort.h"
void ShellTime()
{
	srand((unsigned int)time(0));
	int clock1 = clock();
	int a[100000] = { 0 };
	for (int i = 0; i < 10000; i++)
	{
		a[i] = rand();
	}
	ShellSort(a, sizeof(a) / sizeof(a[0]));
	int clock2 = clock();
	printf("Shelltime:%d\n", clock2 - clock1);
}
void InsertTime()
{
	srand((unsigned int)time(0));
	int clock1 = clock();
	int a[100000] = { 0 };
	for (int i = 0; i < 10000; i++)
	{
		a[i] = rand();
	}
	InsertSort(a, sizeof(a) / sizeof(a[0]));
	int clock2 = clock();
	printf("InsertTime:%d\n", clock2 - clock1);
}
void TestQuickSortNonR()
{
	int arr1[] = { 1,2,3,4,5,6,7,8,9,10 };
	QuickSortNonR(arr1, 0, sizeof(arr1) / sizeof(arr1[0]) - 1);
	print(arr1, sizeof(arr1) / sizeof(arr1[0]));
}
void TestQuickSort()
{
	int arr1[] = { 1,2,3,4,5,6,7,8,9,10 };
	QuickSort(arr1, 0,sizeof(arr1) / sizeof(arr1[0])-1);
	print(arr1, sizeof(arr1) / sizeof(arr1[0]));
}
void TestHeapSort()
{
	int arr1[] = { 3,2,5,1,7,4,7,0,7 };
	HeapSort(arr1, sizeof(arr1) / sizeof(arr1[0]));
	print(arr1, sizeof(arr1) / sizeof(arr1[0]));
}
void TestBubbleSort()
{
	int arr1[] = { 3,2,5,1,7,4,7,0,7 };
	BubbleSort(arr1, sizeof(arr1) / sizeof(arr1[0]));
	print(arr1, sizeof(arr1) / sizeof(arr1[0]));
}
void TestInsertSort()
{
	int arr1[] = { 3,2,5,1,7,4,7,0,7 };
	InsertSort(arr1, sizeof(arr1) / sizeof(arr1[0]));
	print(arr1, sizeof(arr1) / sizeof(arr1[0]));
}
void TestShellSort()
{
	int arr1[] = { 3,2,5,1,7,4,7,0,7 };
	ShellSort(arr1, sizeof(arr1) / sizeof(arr1[0]));
	print(arr1, sizeof(arr1) / sizeof(arr1[0]));
}
void TestSelectSort()
{
	int arr1[] = { 3,2,5,1,7,4,7,0,7 };
	SelectSort(arr1, sizeof(arr1) / sizeof(arr1[0]));
	print(arr1, sizeof(arr1) / sizeof(arr1[0]));
}
int main()
{
	/*TestInsertSort();
	TestShellSort();*/
	/*TestBubbleSort();
	TestSelectSort();
	TestHeapSort();*/
	TestQuickSort();
	/*TestQuickSortNonR();*/
	/*ShellTime();
	InsertTime();*/
	return 0;
}